﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CliffPusher
{
    public partial class ucPlayerCard : UserControl
    {
        public ucPlayerCard()
        {
            InitializeComponent();
        }

        [Description("The title of the card"), Category("Data")]
        public string CardTitle
        {
            get
            {
                return groupBoxCardName.Text;
            }
            set
            {
                groupBoxCardName.Text = value;
            }
        }

        [Description("The image which appears on the card"), Category("Data")]
        public Image CardImage
        {
            get
            {
                return pictureBoxCardImage.Image;
            }
            set
            {
                pictureBoxCardImage.Image = value;
            }
        }

        [Description("The description at the bottom of the card"), Category("Data")]
        public string CardDescription
        {
            get
            {
                return textBoxCardDescription.Text;
            }
            set
            {
                textBoxCardDescription.Text = value;
            }
        }

        public event Func<ucPlayerCard, bool> PlayingCard;

        private void buttonPlay_Click(object sender, EventArgs e)
        {
            PlayingCard?.Invoke(this);
        }

        private void ucPlayerCard_DoubleClick(object sender, EventArgs e)
        {
            buttonPlay_Click(sender,e);
        }
    }
}
